<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>HTML代码预览器</title>
    <style>
        body {
            background-color: #f2f2f2;
            font-family: Arial, sans-serif;
        }

        .container {
            background-color: #fff;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
            margin: 50px auto;
            padding: 20px;
            max-width: 500px;
            text-align: center;
        }

        h1 {
            font-size: 36px;
            margin-bottom: 30px;
        }

        p {
            font-size: 18px;
            margin-bottom: 50px;
        }

        textarea {
            width: 100%;
            height: 200px;
            padding: 10px;
            resize: none;
        }

        button {
            font-size: 18px;
            padding: 10px 20px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        code {
            background-color: #f9f9f9;
            border-radius: 3px;
            box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
            display: inline-block;
            font-size: 16px;
            margin: 20px auto;
            padding: 10px;
            white-space: pre-wrap;
            width: 70%;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>HTML代码预览器</h1>
        <p>在此输入您要预览的HTML代码</p>
        <textarea id="code" rows="10" cols="50"></textarea>
        <button onclick="preview()">预览</button>
        <div id="preview"></div>
    </div>

    <script>
        function preview() {
            var code = document.getElementById("code").value;
            var preview = document.getElementById("preview");
            preview.innerHTML = code;
        }
    </script>
</body>
</html>
